import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { BaseItem } from "../common/BaseItem";
import { ItemData } from "../../resource/info/ItemData";
//class TreasureBoxItemRenderer
    
    export  class TreasureBoxItemRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            super.configUI();
            ObjCreate.createBitmap(ImagesConst.PackItemBg, 0, 0, this);
            this._item = new BaseItem();
            this._item.setSize(32, 32);
            this._item.move(3, 3);
            this._item.isDragAble = false;
            this._item.isDropAble = false;
            this._item.isShowLock = true;
            addChild(this._item);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=null;
            super.data = arg1;
            if (arg1 && arg1 is ItemData) 
            {
                loc1 = arg1 as ItemData;
                this._item.itemData = loc1;
                this._item.amount = loc1.itemAmount;
            }
            return;
        }

        /* internal */ /* var */_item: BaseItem;
    }
